// pages/jmd/jmd.js
var a = getApp();
Page({

  data: {
    List:[],
    leftid: 0,
    scanReachBottom: false,
  },

  onLoad: function (t) {
    var that = this
    that.fangfa()
  },
  fangfa:function(){
    var that = this
    a.util.request({
      url: "entry/wxapp/Api",
      data: {
        m: "monai_market",
        r: "extends.shops",
        leftid: that.data.leftid += 1
      },
      success: function (e) {
        console.log(e)
        if (e.data.data.length < 10) {
          that.setData({
            scanReachBottom: true,
          })
        }
        that.setData({
          List: that.data.List.concat(e.data.data) 
        })
      }
    });
  },
  shuaxin:function(){
    if (!this.data.scanReachBottom) {
      this.fangfa()
    }
  },
  dj:function(e){
    console.log(e)
    var uid = e.currentTarget.dataset.uid
    wx.navigateTo({
      url: '../store/index?scene=' + uid,
    })
  }

})